import { _decorator, Component, Label, Node } from 'cc';
import { aa } from '../frame/FrameCore';
import configs from '../Configs';
const { ccclass, property } = _decorator;

// const models = ["gpt-4","gpt-3.5-turbo", "wenxin", "wenxin-4", "xunfei"]
const models = ["gpt-4-turbo","gpt-3.5-turbo","gpt-4"]

@ccclass('ModelCtrl')
export class ModelCtrl extends Component {

    @property(Label) mLabel:Label = null;
    private _index = 0;

    start() {
        this.mLabel.string = configs.model;
        this.node.on(Node.EventType.TOUCH_END,this.onClick,this);
    }

    onClick(){
        this._index ++;
        if(this._index>=(models.length))this._index = 0;
        const model =models[this._index]
        configs.model = model;
        aa.ui.toast("Current Model "+model);
        this.mLabel.string = configs.model;
    }

}

